package com.sbj.dto.res;

import cn.zhxu.bs.bean.DbField;
import cn.zhxu.bs.bean.SearchBean;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.sbj.dto.jackson.CustomDecimalSerialize;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * @author summer
 * @version 1.0
 * @date 2024/8/12 08:59
 */
@Data
@SearchBean(tables = " buy_goods b    LEFT JOIN  member m On b.member_id = m.id AND m.id=:memberId"
,autoMapTo = "b",orderBy = "b.createTime DESC")
public class BuyGoodsRes implements Serializable {

    @DbField("b.id")
    private Integer id;

    @DbField("b.goods_name")
    private String goodsName;

    @DbField("b.goods_price")
    @JsonSerialize(using = CustomDecimalSerialize.class)
    private BigDecimal goodsPrice;

    @DbField("b.goods_num")
    private Integer goodsNum;

    @DbField("b.grounding")
    private Integer grounding;

    @DbField("b.goods_image")
    private String image;

    @DbField("CASE WHEN m.nickName IS NOT NUll THEN 1 ELSE 0 END")
    private Integer memberState;


    @DbField("b.deleted")
    private Integer deleted;

    @DbField("b.status")
    private Integer status;

}
